#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int N=1e5+10;
int a[2][N];
void solve()
{
	int m;
	cin>>m;
	int b1num=2*m;
	int s1num=2;
	int b2num=2*m-1;
	int s2num=1;
	for(int i=0;i<m;i++)
	{
		if(i%2==0)
		{
			a[0][i]=b1num;
			b1num-=2;
		}
		else
		{
			a[0][i]=s1num;
			s1num+=2;
		}
	}
	for(int i=m-1,j=0;i>=0;i--)
	{
		if(j%2==0)
		{
			a[1][i]=b2num;
			b2num-=2;
		}
		else
		{
			a[1][i]=s2num;
			s2num+=2;
		}
		j++;
	}
	for(int i=0;i<2;i++)
	{
		for(int j=0;j<m;j++)
		{
			cout<<a[i][j]<<' ';
		}
		cout<<endl;
	}
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		solve(); 
	}

	return 0;
}

